Skip to content

auth: use NATS.NKeys package for nkey signing#1101

Merged
mtmk merged 1 commit into
mainfrom
nkeys-package
Apr 15, 2026
Merged

auth: use NATS.NKeys package for nkey signing#1101
mtmk merged 1 commit into
mainfrom
nkeys-package

Conversation

@mtmk

@mtmk mtmk commented Apr 8, 2026

Copy link
Copy Markdown
Member

Replace the in-tree Ed25519/NKey implementation with the NATS.NKeys package, dropping the vendored NaCl reference implementation and the partial public NKeys/NKeyPair API. Signing now goes through NATS.NKeys.KeyPair and produces byte-for-byte identical signatures.

BREAKING Note this removes the public NATS.Client.Core.NKeys and NKeyPair types: external callers must switch to NATS.NKeys.KeyPair.

The Ed25519 reference implementation under NaCl/ and the partial
public NKeys/NKeyPair API have lived in NATS.Client.Core since the
fork from AlterNats. The NATS.NKeys package now ships the same
functionality as a maintained, audited dependency, so the in-tree
copy can go.

UserCredentials signs through NATS.NKeys.KeyPair instead, producing
byte-for-byte identical signatures. The legacy NKeyPair.Sign also
wiped its expanded private key after the first call, so any external
caller signing more than once would silently get bad signatures;
in-tree usage was always one-shot so behavior is unchanged.

This removes the public NATS.Client.Core.NKeys and NKeyPair types.
External callers must switch to NATS.NKeys.KeyPair.
@mtmk mtmk self-assigned this Apr 8, 2026
@mtmk mtmk added the breaking label Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

@mtmk
mtmk requested a review from aricart April 8, 2026 07:31
@mtmk
mtmk requested a review from scottf April 15, 2026 10:14

@scottf scottf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mtmk
mtmk merged commit be0a05b into main Apr 15, 2026
24 checks passed
@mtmk
mtmk deleted the nkeys-package branch April 15, 2026 10:28
This was referenced Apr 16, 2026
@mtmk mtmk mentioned this pull request May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants